<template>
  <div class="xiangqing2_total">
    <ul class="maney_ul">
      <li><span>定金：{{ data.preparidAmount }}元</span><span>加油服务费：2222222元</span></li>
      <li><span>使用费：{{ data.totalPrice - data.preparidAmount }}元</span><span>油费：222222元</span></li>
      <li><span>基本保险：222222元</span><span>车辆损失费：222222元</span></li>
      <li>手续费：2222222 </li>
    </ul>
    <div class="botom_totalmoney_btn">
      <p>合计：<span>{{ data.totalPrice }}</span> 元</p>
      <div>
        <van-button class="bot_btn_col" color="#eeeeee" @click="go_pay"
          >立即支付</van-button
        >
        <van-button class="bot_btn_col" color="#eeeeee" @click="close_order"
          >取消订单</van-button
        >
      </div>
    </div>
  </div>
</template>

<script>
import { closeOrder } from "../../../request/userinfo/userinfo";
export default {
  props: ['data'],
  data() {
    return {

    };
  },
  methods: {
    go_pay() {
      //alert(JSON.stringify(this.data))
      this.$store.state.shopname=this.data.name
      //alert(JSON.stringify(this.data.startTime))
      this.$store.state.startime=this.data.startTime
      this.$store.state.endtime=this.data.endTime
      this.$store.state.startime_=new Date(this.data.startTime)
      this.$store.state.endtime_=new Date(this.data.endTime)
      this.$router.push("/dingdanxiangqing/");
    },
    close_order() {
      closeOrder({
        id: this.data.id,
        state: this.$store.state.orderState[2].state,
    })
      .then((res) => {
        if(res.code==2000) {
          this.$toast.fail("成功");
          this.$router.push("/wodedingdan4");
        }else {
          alert("操作失败")
        }
      });
    },
  },
  components: {},
};
</script>

<style scoped lang="less">
.xiangqing2_total {
  width: 100%;
  .maney_ul {
    width: 100%;
    height: 2.59rem;
    padding: 0.1rem 0.38rem;
    border-bottom: 0.01rem solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    li {
      font-size: 0.23rem;
      color: #666666;
      span:last-child {
        width: 2rem;
        float: right;
        margin-right: 0.1rem;
      }
    }
  }
  .botom_totalmoney_btn {
    height: 5.03rem;
    p {
      font-size: 0.23rem;
      color: #333;
      margin-top: 0.24rem;
      padding-left: 0.38rem;
      margin-bottom: 0.6rem;
      font-weight: 600;
      span {
        font-size: 0.36rem;
        font-weight: 600;
        color: #333;
      }
    }
    div {
      display: flex;
      justify-content: center;
      button:first-child {
        margin-right: 0.4rem;
      }
      button {
        width: 2.5rem;
        height: 0.9rem;
        border: 0.01rem solid #cccccc !important;
        border-radius: 0.1rem;
      }
      .bot_btn_col span {
        color: #666;
        font-weight: 600;
        font-size: 0.29rem;
      }
    }
  }
}
</style>
